[client]
port={{mysql_run_port}}
socket={{mysql_base}}/mysql.sock

[mysqld]
basedir={{mysql_base}}
datadir={{mysql_data}}
port={{mysql_run_port}}
socket={{mysql_base}}/mysql.sock
user={{mysql_run_user}}

server_id={{serverid}}

skip_ssl
#开启binlog日志
binlog-format=Row
log-bin={{mysql_logs}}/binlog/mysql-bin
relay-log={{mysql_logs}}/relaylog/relay-log
sql_mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER"

#开启错误日志，慢日志
log-error={{mysql_logs}}/mysqld.log

slow_query_log=ON
slow_query_log_file={{mysql_logs}}/slow_query.log
long_query_time=1

interactive_timeout=1800
wait_timeout=1800

skip_name_resolve=1
max_connections=1024

expire_logs_days=7
max_binlog_size=500M

##GTID
gtid_mode=on                 #开启gtid模式
enforce_gtid_consistency=on  #强制GTID一致性
log-slave-updates=on
master_info_repository=TABLE
relay_log_info_repository=TABLE

explicit_defaults_for_timestamp=true #关闭错误警告
character-set-server=utf8
init-connect='SET NAMES utf8'
collation-server =utf8_general_ci
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1024M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
innodb_file_per_table = 1

[client]
default-character-set=utf8

[mysql]
default-character-set=utf8
